package yo.latyoo.hokage.tools.parameter;

import java.io.Serializable;

public class HO<T> implements Serializable {
    public int code = 200;
    public String msg = "SUCCESS";
    public static final int SUCCESS_CODE = 200;
    public static final int BAD_REQUEST_CODE = 400;
    public static final int SERVER_ERROR = 500;
    public T data;

    public HO() {
    }

    public HO(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public HO(int code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    public HO(T data) {
        this.data = data;
    }

    public static <T> HO<T> OK(T data) {
        return new HO<>(data);
    }

    public static <T> HO<T> OK() {
        return new HO();
    }

    public static HO BAD_REQUEST(String msg) {
        return new HO(400, msg);
    }

    public static HO INTERNAL_SERVER_ERROR(String msg) {
        return new HO(500, msg);
    }

 /*   public String toString() {
        int var10000 = this.code;
        return "HO{code=" + var10000 + ", msg='" + this.msg + "', data=" + (this.data == null ? "" : JacksonUtil.toJson(this.data)) + "}";
    }*/
}
